package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.Product;
import com.ruoyi.system.domain.ProductDto;
import com.ruoyi.system.mapper.ProductMapper;
import com.ruoyi.system.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.dc.pr.PRError;

import java.util.List;

@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public Product getAll(Integer categoryId, Integer productId, String productName) {
        Product all = productMapper.getAll(categoryId, productId, productName);
        return all;
    }

    @Override
    public List<ProductDto> selectAll(Integer categoryId,Integer productId,String productName) {
        List<ProductDto> products = productMapper.selectAll(categoryId,productId,productName);
        return products;
    }

    @Override
    public List<Product> selectByDetail(Integer categoryId,Integer productId, String productName) {
        List<Product> products = productMapper.selectByDetail(categoryId,null,null);
        return products;
    }
}
